import { Component, Vue, Prop } from 'vue-property-decorator'
import Table from '../table.vue'
import quickSearch from '@/common/views/advancedSearch/QuickSearch.vue'
import { CommonModule } from '@/store/modules/common/index'
import { toHMS } from './review.js'
@Component({
  name: 'MonitoringMixins',
  components: { Table, quickSearch }
})
export default class extends Vue {
  public toHMS (val) {
    return toHMS(val)
  }

  private toSerach (val) {
    this.$emit('search')
  }

  // #region
  // private tableData = []
  // #endregion

  // #region

  // #endregion
  get queueList () {
    return CommonModule.publicCache.queueList
  }

  public toPercentage (val) {
    let result
    if (isNaN(Number(val))) {
      result = '0%'
    } else {
      result = (Number(val) * 100).toFixed(2) + '%'
    }
    return result
  }

  public get userList () {
    const list: any = CommonModule.publicCache.userList
    list.forEach(i => {
      i.realName = i.agentNumber + `  ${i.agentName ? '(' + i.agentName + ')' : ''}`
    })
    return list
  }
}
